﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Sai_Se_Dung
{
    public class Data : INotifyPropertyChanged
    {
        
        private string q; // question
        private string a; // answer a
        private string b; // answer b
        private string r; // result

        public string Q
        {
            get 
            {
                return q; 
            }
            set 
            {
                q = value;
                NotifyPropertyChanged("Q");
            }
        }
        public string A
        {
            get
            {
                return a;
            }
            set
            {
                a = value;
                NotifyPropertyChanged("A");
            }
        }
        public string B
        {
            get
            {
                return b;
            }
            set
            {
                b = value;
                NotifyPropertyChanged("B");
            }
        }
        public string R
        {
            get
            {
                return r;
            }
            set
            {
                r = value;
                NotifyPropertyChanged("R");
            }
        }

        /// <summary>
        /// Thay đổi thuộc tính khi xử lý
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
